package n1014;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	static int[] p=new int[6];
	
	static int[] f=new int[210001];
	
	static int max;
	
	static void zeroOnePack(int weight,int cost)
	{
		for(int i=max;i>=cost;i--)
		{
			if(f[i]<f[i-cost]+weight)f[i]=f[i-cost]+weight;
		}
	}
	
	static void completePack(int weight,int cost)
	{
		for(int i=cost;i<=max;i++)
		{
			if(f[i]<f[i-cost]+weight)f[i]=f[i-cost]+weight;
		}
	}
	
	static void solve()
	{
		int sum=0;
		for(int i=0;i<6;i++)sum+=p[i]*(i+1);
		if((sum&1)==1) {
			System.out.println("Can't be divided.");
		}else {
			max=sum>>1;
			for(int i=0;i<max+1;i++)f[i]=0;
			for(int i=0;i<6;i++)
			{
				if((i+1)*p[i]>=max)
				{
					completePack(i+1, i+1);
				}else {
					for(int k=1;k<=p[i];k*=2)
					{
						zeroOnePack(k*(i+1), k*(i+1));
						p[i]-=k;
					}
					if(p[i]>0)zeroOnePack(p[i]*(i+1), p[i]*(i+1));
				}
			}
			if(f[max]==max)
			{
				System.out.println("Can be divided.");
			}else {
				System.out.println("Can't be divided.");
			}
		}
	}
	
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {

		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		
		String line=null;
		int count=0;
		while((line=bf.readLine())!=null)
		{
			StringTokenizer st=new StringTokenizer(line);
			boolean stop=true;
			for(int i=0;i<6;i++) {
				p[i]=Integer.parseInt(st.nextToken());
				if(stop&&p[i]!=0)stop=false;
			}
			if(stop)break;
			System.out.println("Collection #"+(++count)+":");
			solve();
			System.out.println();
		}
	}

}
